//
//  MusicModel.h
//  Blue-toothLight
//
//  Created by mazg on 15/6/16.
//  Copyright (c) 2015年 mazg. All rights reserved.
//

#import <Foundation/Foundation.h>

/*
 本类中涉及到的临时数据保存可以通过NSUserDefault来存储，只需要存储一个当前正在播放的model就行了
 
 使用方法如下：
     MusicModel *model=[MusicModel allMusicsFromLocal][0];
     NSData *data=[NSKeyedArchiver archivedDataWithRootObject:model];
     NSUserDefaults *defaults=[NSUserDefaults standardUserDefaults];
     [defaults setObject:data forKey:@"PlayIngMusic"];
     [defaults synchronize];
     
     
     NSData *data1=[defaults objectForKey:@"PlayIngMusic"];
     MusicModel *temp=[NSKeyedUnarchiver unarchiveObjectWithData:data1];
     NSLog(@"%@",temp.title);
 */

@interface MusicModel : NSObject<NSCoding>
//基本信息
@property (copy, nonatomic) NSString *title;
@property (copy, nonatomic) NSString *artist;
@property (assign, nonatomic) NSTimeInterval playbackDuration;
@property (assign, nonatomic) NSTimeInterval playingTime;
@property (nonatomic,assign) BOOL isSelected;
@property (nonatomic,strong) NSURL *songUrl;

//单粒中存放的临时信息
@property (copy, nonatomic)MusicModel *playingModel;
@property (assign, nonatomic)NSTimeInterval *playimgTime;



//从本地设备获取所有的音乐
+(NSMutableArray *)allMusicsFromLocal;

@end
